<?php
class DispatchPDF extends InvPDF
{

    public function Header()
    {
        $this->y = $this->header_margin;
        $this->x = $this->original_lMargin;
        //$this->Image($file,$x,$y,$w,$h);
        $this->RoundedRect(17, 16.3, 87, 26, 6.50, '1111');
        $this->Image(K_PATH_IMAGES . 'QSI1.png', 23, 17, 25, 24);
        $this->MultiCell(40, 4, 'QSI, INC', false, 'C', false, 1, 65, 17);
        $this->MultiCell(40, 4, '107 Schuler Dr.', false, 'C', false, 1, 63, 22);
        $this->MultiCell(40, 4, 'Bardstown KY 40004', false, 'C', false, 1, 63, 27);
        $this->MultiCell(40, 4, 'Phone: 502-350-1000 ', false, 'C', false, 1, 63, 32);
        $this->MultiCell(40, 4, 'Fax: 502-350-1002 ', false, 'C', false, 1, 63, 37);


        $style6 = array();
        $this->RoundedRect(106.1, 16.3, 87.8, 13, 1.50, '1111', 'DF', $style6, array(12, 0, 0, 0));
        $this->writeHTMLCell(87.8, 20, 106.1, 20, $html = '<h1 style="text-align: center">DISPATCH</h1>');

        $date = explode(' ', $this->invoicedate);

        $formattedDate = $date['0'];
        $html = '                <br/><br/><br/><br/>
<table border="0" cellspacing="10" cellpadding="10"  >
     <tr>

        <th style="width:52%;" align="right" colspan = "2" >

        </th>
        <th  colspan = "2">

              <table cellspacing="1" cellpadding="1" >
                <tr>
                <h2></h2> <br><br>
                    <td align="center" style="background-color: #888888;border: 1px double black;" >Date</td>
                    <td  align="center" style="background-color: #888888;border: 1px double black;">Dispatch No</td>


                </tr>

                <tr>
                <td align="center" style="border: 1px double black;" ><b>' . $formattedDate . '</b></td>
                    <td align="center" style="border: 1px double black;" ><b>' . $this->invoice . '</b></td>

                </tr>
                  </table>

        </th>
    </tr>
    </table>
                ';

        $this->writeHTMLCell(200.5, 10, 0, 0, $html);
        if ($this->getPage() == 1)
        {
            $this->Rect(15, 100, 180, 185, 'D', array('width' => 2));
        }
        else
        {
            $this->Rect(15, 50, 180, 235, 'D', array('width' => 2));
        }
    }

}
